package com.zmx.patientend.adapter;

import android.app.Activity;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.patientend.R;
import com.zmx.patientend.pojo.Doctor;
import com.zmx.patientend.pojo.Registration;

import butterknife.BindView;
import butterknife.ButterKnife;

public class RegistrationAdapter extends BaseAdapterRvList<RegistrationAdapter.ViewHolder, Registration> {

    public RegistrationAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, Registration registration) {

        holder.name.setText(registration.getDoctor_name());
        holder.describe.setText(registration.getTitle_name());
        holder.addres.setText(registration.getClass_name()+" "+registration.getHosp_name());
        holder.bei.setText(registration.getExpertise());
        Glide.with(mActivity).load(registration.getAvatar()).into(holder.head);

    }

    @NonNull
    @Override
    protected ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {

        ViewHolder holder = new ViewHolder(inflater.inflate(R.layout.adapter_registration, parent, false));
        return holder;

    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.head)
        ImageView head;
        @BindView(R.id.name)
        TextView name;
        @BindView(R.id.describe)
        TextView describe;
        @BindView(R.id.addres)
        TextView addres;
        @BindView(R.id.bei)
        TextView bei;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

    }

}
